/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wan.fairul
 */
@Entity
@Table(name = "priority_code")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PriorityCode.findAll", query = "SELECT p FROM PriorityCode p")})
public class PriorityCode implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "priority_code_id")
    private Integer priorityCodeId;
    @Column(name = "priority_name")
    private String priorityName;
    @Column(name = "priority_day")
    private Integer priorityDay;
    @Embedded
    private InfoAudit infoAudit;

    public PriorityCode() {
    }

    public PriorityCode(Integer priorityCodeId) {
        this.priorityCodeId = priorityCodeId;
    }

    public Integer getPriorityCodeId() {
        return priorityCodeId;
    }

    public void setPriorityCodeId(Integer priorityCodeId) {
        this.priorityCodeId = priorityCodeId;
    }

    public String getPriorityName() {
        return priorityName;
    }

    public void setPriorityName(String priorityName) {
        this.priorityName = priorityName;
    }

    public Integer getPriorityDay() {
        return priorityDay;
    }

    public void setPriorityDay(Integer priorityDay) {
        this.priorityDay = priorityDay;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (priorityCodeId != null ? priorityCodeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PriorityCode)) {
            return false;
        }
        PriorityCode other = (PriorityCode) object;
        if ((this.priorityCodeId == null && other.priorityCodeId != null) || (this.priorityCodeId != null && !this.priorityCodeId.equals(other.priorityCodeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.PriorityCode[ priorityCodeId=" + priorityCodeId + " ]";
    }
}
